package com.landmesure.communication;


import android.os.Handler;

import com.sensor.Manager.GangXuanShiShenYaJiManager;
import com.sensor.Manager.WaterMonitorManager;

import java.util.HashMap;
import java.util.Map;

public class ManagerFactory {


    private static Map<String,BaseManager> managerMap=new HashMap<>();
    public static BaseManager getRealManager(String type,Handler handler) {
        switch (type) {
            case "读取板子":
                return new ReadBoardManager(handler);
            case "钢铉式渗压计检测":
               return new GangXuanShiShenYaJiManager(handler);
            case "水质监测":
                if (managerMap.get(type)==null){
                    managerMap.put(type,new WaterMonitorManager(handler));
                }
               return managerMap.get(type);
            default:
                return null;

        }
    }

}
